wayland: Protect against NULL offers on gdk_drag_status() implementation
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 20 Jan 2016 17:55:51 +0000 (18:55 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 20 Jan 2016 17:55:51 +0000 (18:55 +0100)
If we're called untimely, we might end up crashing here when poking the
NULL wl_data_offer.

gdk/wayland/gdkdnd-wayland.c

index 2787e5916d6e52d8827c7e9fec23a6479f7ebfa9..cf2376df268bad291d60f6cd7a2f98f653baf6a3 100644 (file)
@@ -315,7 +315,7 @@ gdk_wayland_drag_context_drop_finish (GdkDragContext *context,
   selection = gdk_drag_get_selection (context);
   wl_offer = gdk_wayland_selection_get_offer (display, selection);
 
-  if (success && wayland_context->selected_action &&
+  if (wl_offer && success && wayland_context->selected_action &&
       wayland_context->selected_action != GDK_ACTION_ASK)
     {
       gdk_wayland_drag_context_commit_status (context);